package com.caesar.method_son;

import com.caesar.method_fa.Graphic;

/**
 * @author caesar
 * @date 2025/7/9
 * @Description:
 * @apiNote
 */
public class Rectangle extends Graphic {
    private double width;
    private double height;

    public Rectangle() {
    }

    public Rectangle(double height,double width) {
        this.width = width;
        this.height = height;
    }

    public double getWidth() {
        return width;
    }

    public void setWidth(double width) {
        this.width = width;
    }

    public double getHeight() {
        return height;
    }

    public void setHeight(double height) {
        this.height = height;
    }

    @Override
    public double area() {
        return height * width;
    }

    @Override
    public double perimeter() {
        return 2 * (height + width);
    }

    @Override
    public String toString() {
        return "长：" +height +
                "，宽：" + width +
                super.toString();
    }
}
